<?php 
/**
 *   Joomdiet - administrator/components/views/recipe/tmpl/default.php
 *   Author: Juan Dapena Paz (juan@bittingbits.com)
 *   Copyright (C) 2010 Bitting Bits S.L.
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
    <thead>
        <tr>
            <th width="20">
                <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
            </th>
            <th width="5">
                <?php echo JText::_('ID'); ?>
            </th>
            <th width="220px">
                <?php echo JText::_('COM_JOOMDIET_RECIPE'); ?>
            </th>
            <th>
                <?php echo JText::_('COM_JOOMDIET_DESCRIPTION'); ?>
            </th>
            <th width="100px">
                <?php echo JText::_('COM_JOOMDIET_CATEGORY'); ?>
            </th>
            <th width="50px">
                <?php echo JText::_('COM_JOOMDIET_DELETE'); ?>
            </th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="6"><?php echo $this->pagination->getListFooter(); ?></td>
        </tr>
    </tfoot>
    <tbody>
        <?php
        $i = 0;
        $k = 0;
        foreach ($this->items as &$row) { 
            $checked = JHTML::_('grid.id', $i, $row->id); ?>
            <tr class="<?php echo 'row'.$k; ?>">
                <td>
                    <?php echo $checked; ?>
                </td>
                <td>
                    <?php echo $row->id; ?>
                </td>
                <td>
                    <a href="index.php?option=com_joomdiet&controller=recipe&task=editRecipe&cid[]=<?php echo $row->id; ?>"><?php echo $row->name; ?></a>
                </td>
                <td>
                    <?php echo $row->description; ?>
                </td>
                <td>
                    <?php echo $row->recipe_category_id; ?>
                </td>
                <td>
                    <a href="index.php?option=com_joomdiet&controller=recipe&task=deleteRecipe&cid[]=<?php echo $row->id; ?>"><?php echo JText::_('COM_JOOMDIET_DELETE'); ?></a>
                </td>
            </tr>
        <?php $k = 1 - $k; $i++; } ?>
    </tbody>
    </table>
</div>

<input type="hidden" name="option" value="com_joomdiet" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="recipe" />
<input type="hidden" name="view" value="recipe" />

</form>
